// vuex
import Vue from 'vue'
import Vuex from 'vuex'
import user from './module/user'
import routes from './module/routes'

Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production'

export default new Vuex.Store({
  state: {
    title: '',
    loginStatus: false,
    session_id: ''
  },
  getters: {
    documentTitle: state => state.title
  },
  mutations: {
    updateTitle(state, value) {
      state.title = value
    },
    updateLoginStatus(state, value) {
      state.loginStatus = value
    },
    updateSessionId(state, value) {
      state.session_id = value
    }
  },
  modules: {
    user,
    routes
  },
  strict: debug
})
